/*------------------------------------*\
    $MIXINS
\*------------------------------------*/
/**
 * MIXINS COLLECTION
 * 
 * Designed and built @kurenn  
 */

//Clears the float from any element
@mixin clearfix {
  &:before, &:after {
    display: table;
    content: "";
  }

  &:after {
    clear: both;
  }
}

@mixin inline-block {
  display: inline-block;
  zoom: 1;
  *display: inline;
}

@mixin center-block {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@mixin hyphens($mode: auto) {
  word-wrap: break-word;
  -webkit-hyphens: $mode;
  -moz-hyphens: $mode;
  -ms-hyphens: $mode; // IE10+
  -o-hyphens: $mode;
  hyphens: $mode;
}

//Credits to bootstrap
@mixin responsive-invisibility {
  display: none !important;

  tr, th, td {
    display: none !important;
  }
}

@mixin responsive-visibility {
  display: block !important;

  &.btn {
    display: inline-block !important;
  }

  tr {
    display: table-row !important;
  }

  th, td {
    display: table-cell !important;
  }
}
@mixin opacity ( $opacity ) {
  opacity: $opacity;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=" $opacity * 100 ")";
  filter: alpha(opacity= $opacity* 100 );
  zoom: 1;
}


@mixin img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

// FORMS
// --------------------------------------------------

// Block level inputs
@mixin input-block-level {
  display: block;
  width: 100%;
  min-height: $input-height; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
  @include box-sizing(border-box); // Makes inputs behave like true block-level elements
}

@mixin dropdown-arrow($color: $select-options-bg, $top: 5px, $left: 15px, $size: 9px) {

  &:before {
    content: '';
    border-style: solid;
    border-width: 0 $size $size $size;
    border-color: transparent transparent $color transparent;
    height: 0px;
    position: absolute;
    left: $left;
    top: $top;
    width: 0px;
    // Make corners smooth
    -webkit-transform: rotate(360deg);
  }
}

@mixin nav-divider($top: #e5e5e5, $bottom: #FFF) {
  // IE7 needs a set width since we gave a height. Restricting just
  // to IE7 to keep the 1px left/right space in other browsers.
  // It is unclear where IE is getting the extra space that we need
  // to negative-margin away, but so it goes.
  *width: 100%;
  height: 1px;
  margin: (($base-line-height / 2) - 1) 1px; // 8px 1px
  *margin: -5px 0 5px;
  overflow: hidden;
  background-color: $top;
  border-bottom: 1px solid $bottom;
}

@mixin touch-callout {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: moz-none;
  -ms-user-select: none;
  user-select: none;
}

// Font Awesome Mixins 
// --------------------------

@mixin icon($icon) {
  @include icon-FontAwesome();
  content: $icon;
}

@mixin icon-FontAwesome() {
  font-family: FontAwesome;
  font-weight: normal;
  font-style: normal;
  text-decoration: inherit;
  -webkit-font-smoothing: antialiased;
  *margin-right: .3em; // fixes ie7 issues
}

@mixin icon-stack($width: 2em, $height: 2em, $top-font-size: 1em, $base-font-size: 2em) {
  .icon-stack {
    position: relative;
    display: inline-block;
    width: $width;
    height: $height;
    line-height: $width;
    vertical-align: -35%;
    [class^="icon-"],
    [class*=" icon-"] {
      display: block;
      text-align: center;
      position: absolute;
      width: 100%;
      height: 100%;
      font-size: $top-font-size;
      line-height: inherit;
      *line-height: $height;
    }
    .icon-stack-base {
      font-size: $base-font-size;
      *line-height: #{$height / $base-font-size}em;
    }
  }
}

@mixin build-column-grids($columns: 12) {
  $unit-width: (100 / $columns);  
  $column-factor: 0.1833;


  @for $i from 1 through $columns {
    .col-#{$i} {
      $current-width: ($unit-width * $i) - $column-factor;
      width: percentage($current-width / 100);
      margin-left: percentage($column-factor / 100);
    }
  }

}

@mixin backface-visibility($property: hidden) {
	-webkit-backface-visibility: $property;
	-moz-backface-visibility: $property;
	backface-visibility: $property;
}

@mixin perspective($value: 1300px) {
	-webkit-perspective: $value;
	-moz-perspective: $value;
	perspective: $value;
}
